import java.util.*;

/**
 * @author ht
 * @create 2025-06-29 20:39
 * @desc
 **/
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        String s = scanner.next();
        System.out.println(replaceNumber(s, k));
        scanner.close();
    }

    private static String replaceNumber(String s, int k) {
        return s.substring(s.length() - k, s.length()) + s.substring(0, s.length() - k);
    }


    //private static String replaceNumber(String str) {
    //    StringBuilder sb = new StringBuilder();
    //    for (int i = 0; i < str.length(); i++) {
    //        char charAt = str.charAt(i);
    //        if(charAt - '0' >= 0 && charAt - '0' < 10) {
    //            sb.append("number");
    //        } else {
    //            sb.append(charAt);
    //        }
    //    }
    //    return sb.toString();
    //}
}
